<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<script type="text/javascript">
function deleteAd(ad_no) {
	if( confirm("정말 삭제하시겠습니까?")) {
		$.ajax({
			url: "deleteGGame.ga",
			type: "post",
			dataType: "html",
			data: {
				ad_no: ad_no
			},
			success: function(data) {
				if(data > 0) {
					alert("삭제되었습니다.");
					location.href = "getGgong.ga";
				} else {
					alert("오류가 발생하였습니다. 다시 시도해주세요.");
				}
			},
			error: function() {
				alert("오류");
			}
		});
	}
}
</script>

<style type="text/css">
#detailT1 td, #detailT2 td, #detailT3 td {
	border: 1px solid #bbbbbb;
}
#detailT1 tr td:first-child {
	width: 20%;
}

</style>

<script type="text/javascript">
$(function() {
	$("#detailT1 tr td:first-child").attr("class", "table_titleHeight");
	$("#detailT2 tr:first-child, #detailT3 tr:first-child").attr("class", "table_title");
});
</script>

</head>
<body>

<h2>광고 상세 보기</h2>
<table id="detailT1" cellspacing="0" cellpadding="8" style="width:100%;">
	<tr>
		<td>광고번호</td>
		<td>${resultClass.ad_no }</td>
	</tr>
	<tr>
		<td>게임명</td>
		<td>${resultClass.game_title }</td>
	</tr>
	<tr>
		<td>광고명</td>
		<td>${resultClass.contents_title }</td>
	</tr>
	<tr>
		<td>광고주명</td>
		<td>${resultClass.coname }</td>
	</tr>
	<tr>
		<td>광고시행날짜</td>
		<td>${resultClass.days }</td>
	</tr>
	<tr>
		<td>선/후불</td>
		<td>${resultClass.paytype }</td>
	</tr>
	<tr>
		<td>보장노출수</td>
		<td>${resultClass.promisepv }</td>
	</tr>
	<tr>
		<td>미션 점수</td>
		<td>${m_score }</td>
	</tr>
	<tr>
		<td>꽁 제공량</td>
		<td>${offerGgong }</td>
	</tr>
</table>
<br/>


<h3>이미지</h3>
<table id="detailT3" cellspacing="0" cellpadding="8" style="width:100%;text-align:center;">
	<tr>
		<td>메인이미지</td>
		<td>디테일1</td>
		<td>디테일2</td>
		<td>디테일3</td>
	</tr>
	<tr>
		<td style="width:25%;"><img src="resources/images/uploadFiles/${resultClass.imgcontents1_savname }" style="width:100%;"/></td>
		<td style="width:25%;"><img src="resources/images/uploadFiles/${resultClass.imgcontents2_savname }" style="width:100%;"/></td>
		<td style="width:25%;"><img src="resources/images/uploadFiles/${resultClass.imgcontents3_savname }" style="width:100%;"/></td>
		<td style="width:25%;"><img src="resources/images/uploadFiles/${resultClass.imgcontents4_savname }" style="width:100%;"/></td>
	</tr>
</table>
<br/><br/>

<div style="text-align:center;">
	<input type="button" value="이전" style="width:80px; height:24px;" onclick="history.back(-1)"/>
	<input type="button" value="삭제" style="width:80px; height:24px;" onclick="deleteAd(${resultClass.ad_no })"/>
</div>

</body>
</html>